<template>
  <div class="ArtistList">
    <div class="header">
      <span class="left">入驻歌手</span>
      <span @click="screenSinger" class="right">查看全部 ></span>
    </div>
    <div class="list-box">
      <div v-for="item in artistListArr" :key="item.id" class="list" @click="screenUserpage(item)">
        <div class="img">
          <img :src="item.picUrl" alt="">
        </div>
        <div class="details">
          <div class="title">{{item.name}}</div>
          <div class="info">{{item.briefDesc}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {artistList} from '@/api'
  export default {
    name:"ArtistList",
    data() {
      return {
        artistListArr: []
      }
    },
    created () {
      this.init()
    },
    methods: {
      init() {
        this.getArtistList()
      },
      getArtistList(){
        artistList({
          limit:5
        }).then(data=>{
          this.artistListArr = data.artists
        })
      },
      screenUserpage(val){
        if(!val.accountId){
          this.$Notification("此用户暂无信息")
          return 
        }
        this.$router.push({
          name:"userpage",
          query:{
            id:val.accountId
          }
        })
      },
      screenSinger(){
        this.$router.push({
          name:"findMusicSinger"
        })
      }
    },
  }
</script>

<style lang="scss" scoped>
.ArtistList{
  margin:10px 20px;
  .list-box{
    .list{
      display: flex;
      cursor: pointer;
      .img{
        // width:60px;
        height:100%;
        // display: flex;
        // justify-content: center;
        // align-items: center;
        img{height:100%;}
      }
      .details{
        margin:6px 0;
        margin-left:14px;
        display: flex;
        // align-items: center;
        justify-content: space-between;
        flex-direction: column;
        .title{
          font-size:14px;
          color:rgb(51,51,51);
          font-weight:600;
        }
        .info{
          // margin-top:10px;
          font-size:12px;
          color:rgb(102,102,102);
        }
      }
      &:hover{
        background-color: rgb(244,244,244);
      }
      margin-top:15px;
      // width:210px;
      height:60px;
      box-sizing: border-box;
      border:1px solid rgb(233,233,233);
      background:rgb(250,250,250);
    }
  }
  .header{
    border-bottom:1px solid rgb(204,204,204);
    font-size:12px;
    color:rgb(51,51,51);
    display: flex;
    justify-content: space-between;
    padding-bottom:6px;
    .left{
      font-weight:600;
    }
    .right{
      cursor: pointer;
      color:rgb(102,102,102);
      &:hover{
        text-decoration: underline;
      }
    }
  }
}
</style>